#include "EbnEffect.h"


CEbnEffect::~CEbnEffect(void)
{
}

CEbnEffect::CEbnEffect(CEbnWorldState * worldState, bool positiveEffect) :
    CEbnProposition(worldState, positiveEffect)
{
    mExpectation = 1;
}


float CEbnEffect::getExpectation(void)
{
    return mExpectation;
}

void  CEbnEffect::setExpectation(float expectation)
{
    mExpectation = expectation;
}

bool CEbnEffect::hasPointToLink(CEbnLink * pLink)
{
    vector<CEbnLink *>::iterator itLink;
    for (itLink = mPointToLinkList.begin(); itLink != mPointToLinkList.end(); itLink++)
    {
        if ((*itLink) == pLink)
        {
            return true;
        }
    }

    return false;
}

void CEbnEffect::addPointToLink(CEbnLink * pLink)
{
    bool exist = hasPointToLink(pLink);

    if (exist == false)
    {
        mPointToLinkList.push_back(pLink);
    }
}

CEbnProposition * CEbnEffect::getProposition()
{
    return (CEbnProposition*) this;
}
